using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;

namespace Controllers
{
	
	[HandleError]
	public class HomeController : Controller
	{
		public ActionResult Index()
		{
			ViewData["message"] = "Powered by ASP.NET MVC!";
			ViewData["a"] = 3;
			ViewData["b"] = 4.7;
			ViewData["numbers"] = new List<string>() { "One", "Two", "Three", "Four" };
			
			var dict = new Dictionary<string, int>();
			dict.Add("Wendy", 45);
			dict.Add("Paul", 38);
			dict.Add("James", 50);
			
			// Return the dictionary as the model
			return View (dict);
		}
		
		// We are getting a "strongly typed" result from the PHP form
		public ActionResult Display(string freetext)
		{
			// We can pass CLR objects back to PHP
			var person = new { Name = freetext };
			
			return View(person);
		}
	}
}